<!DOCTYPE HTML>
<title>Canvas test: 2d.drawImage.broken</title>
<!--[if IE]><script src="../excanvas/excanvas.js"></script><![endif]-->
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="2d.drawImage.incomplete.html" title="2d.drawImage.incomplete">
<link rel="next" href="2d.drawImage.animated.gif.html" title="2d.drawImage.animated.gif">
<body class="show_output">
<p>
 <a href="2d.drawImage.incomplete.html" accesskey="p" title="[p] 2d.drawImage.incomplete">&lt;</a>
 <a href="index.html">[index]</a>
 <a href="2d.drawImage.animated.gif.html" accesskey="n" title="[n] 2d.drawImage.animated.gif">&gt;</a>
<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.broken</h1>
<p class="desc"></p>
<div class="refs">References:
<ul>
<li><a href="spec.html#testrefs.2d.drawImage.incomplete">2d.drawImage.incomplete</a>

</ul>
</div>

<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>

<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {

var img = document.getElementById('broken.png');
_assertSame(img.complete, false, "img.complete", "false");
try { var _thrown = false;
  ctx.drawImage(img, 0, 0);
} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(img, 0, 0)"); }


});
</script>
<img src="../images/broken.png" id="broken.png" class="resource">

